package system.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import lombok.Data;

@Table(name = "sys_user")
@Data
public class SysUser implements Serializable {
    @Id
    @Column(name = "id")
    private Long id;

    /**
     * 账户名(登录名)
     */
    @Column(name = "username")
    @ApiModelProperty(value = "账户名(登录名)")
    private String username;

    /**
     * 密码
     */
    @JsonIgnore
    @Column(name = "password")
    @ApiModelProperty(value = "密码")
    private String password;

    /**
     * 密码盐
     */
    @JsonIgnore
    @Column(name = "password_salt")
    @ApiModelProperty(value = "密码盐")
    private String passwordSalt;

    /**
     * 密码更新时间
     */
    @Column(name = "password_update")
    @ApiModelProperty(value = "密码更新时间")
    private Date passwordUpdate;

    /**
     * 密码过期时间
     */
    @Column(name = "password_expired")
    @ApiModelProperty(value = "密码过期时间")
    private Date passwordExpired;

    /**
     * 下次登录是否要求修改密码0/1
     */
    @Column(name = "password_next")
    @ApiModelProperty(value = "下次登录是否要求修改密码0/1")
    private Integer passwordNext;

    /**
     * 姓名
     */
    @Column(name = "name")
    @ApiModelProperty(value = "姓名")
    private String name;

    /**
     * 启用状态(0.启用, 1.禁用)
     */
    @Column(name = "is_disabled")
    @ApiModelProperty(value = "启用状态(0.启用, 1.禁用)")
    private Integer isDisabled;

    /**
     * 邮件验证状态 (0.未验证, 1.已验证)
     */
    @Column(name = "is_mail")
    @ApiModelProperty(value = "邮件验证状态 (0.未验证, 1.已验证)")
    private Integer isMail;

    /**
     * 电话验证状态 (0.未验证, 1.已验证)
     */
    @Column(name = "is_mobile")
    @ApiModelProperty(value = "电话验证状态 (0.未验证, 1.已验证)")
    private Integer isMobile;

    /**
     * 注册审批状态 (0.待审批, 1.已批准, 2.已拒绝)
     */
    @Column(name = "reg_approval")
    @ApiModelProperty(value = "注册审批状态 (0.待审批, 1.已批准, 2.已拒绝)")
    private Integer regApproval;

    /**
     * 最后登录时间
     */
    @Column(name = "login_time")
    @ApiModelProperty(value = "最后登录时间")
    private Date loginTime;

    /**
     * 最后登录IP
     */
    @Column(name = "login_ip")
    @ApiModelProperty(value = "最后登录IP")
    private String loginIp;

    /**
     * 登录次数
     */
    @Column(name = "login_count")
    @ApiModelProperty(value = "登录次数")
    private Integer loginCount;

    /**
     * 用户来源, create, register, ...
     */
    @Column(name = "source")
    @ApiModelProperty(value = "用户来源, create, register, ...")
    private String source;

    /**
     * 用户邮箱
     */
    @Column(name = "mail")
    @ApiModelProperty(value = "用户邮箱")
    private String mail;

    /**
     * 手机号码
     */
    @Column(name = "mobile")
    @ApiModelProperty(value = "手机号码")
    private String mobile;

    /**
     * 电话号码
     */
    @Column(name = "phone")
    @ApiModelProperty(value = "电话号码")
    private String phone;

    /**
     * 分机号码
     */
    @Column(name = "phone_ext")
    @ApiModelProperty(value = "分机号码")
    private String phoneExt;

    /**
     * 头像
     */
    @Column(name = "avatar")
    @ApiModelProperty(value = "头像")
    private String avatar;

    /**
     * 所属部门ID
     */
    @Column(name = "dept_id")
    @ApiModelProperty(value = "所属部门ID")
    private Integer deptId;

    /**
     * 岗位ID
     */
    @Column(name = "post_id")
    @ApiModelProperty(value = "岗位ID")
    private Integer postId;

    /**
     * 账号过期时间
     */
    @Column(name = "expired_time")
    @ApiModelProperty(value = "账号过期时间")
    private Date expiredTime;

    /**
     * 创建/注册时间
     */
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建/注册时间")
    private Date createTime;

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    /**
     * 备注
     */
    @Column(name = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    private static final long serialVersionUID = 1L;

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", username=").append(username);
        sb.append(", password=").append(password);
        sb.append(", passwordSalt=").append(passwordSalt);
        sb.append(", passwordUpdate=").append(passwordUpdate);
        sb.append(", passwordExpired=").append(passwordExpired);
        sb.append(", passwordNext=").append(passwordNext);
        sb.append(", name=").append(name);
        sb.append(", isDisabled=").append(isDisabled);
        sb.append(", isMail=").append(isMail);
        sb.append(", isMobile=").append(isMobile);
        sb.append(", regApproval=").append(regApproval);
        sb.append(", loginTime=").append(loginTime);
        sb.append(", loginIp=").append(loginIp);
        sb.append(", loginCount=").append(loginCount);
        sb.append(", source=").append(source);
        sb.append(", mail=").append(mail);
        sb.append(", mobile=").append(mobile);
        sb.append(", phone=").append(phone);
        sb.append(", phoneExt=").append(phoneExt);
        sb.append(", avatar=").append(avatar);
        sb.append(", deptId=").append(deptId);
        sb.append(", postId=").append(postId);
        sb.append(", expiredTime=").append(expiredTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}